package com.onix.scalecamerapreview.translate;

import android.graphics.Rect;

import java.io.File;
import java.util.List;

public class TranslateResult {

    /**
     * detectedLanguage : {"language":"zh-Hans","score":1}
     * translations : [{"text":"Hello, world.","to":"en"}]
     */

    private DetectedLanguageBean detectedLanguage;
    private List<TranslationsBean> translations;
    private File file;

    public File getFile() {
        return file;
    }

    public void setFile(File file) {
        this.file = file;
    }

    public DetectedLanguageBean getDetectedLanguage() {
        return detectedLanguage;
    }

    public void setDetectedLanguage(DetectedLanguageBean detectedLanguage) {
        this.detectedLanguage = detectedLanguage;
    }

    public List<TranslationsBean> getTranslations() {
        return translations;
    }

    public void setTranslations(List<TranslationsBean> translations) {
        this.translations = translations;
    }

    public static class DetectedLanguageBean {
        /**
         * language : 一个字符串，表示检测到的语言的代码
         * score : 一个浮点值，表示结果的置信度。 分数介于 0 和 1 之间，较低的分数表示较低的置信度。
         */

        private String language;
        private int score;

        public String getLanguage() {
            return language;
        }

        public void setLanguage(String language) {
            this.language = language;
        }

        public int getScore() {
            return score;
        }

        public void setScore(int score) {
            this.score = score;
        }
    }

    public static class TranslationsBean {
        /**
         * text : 提供翻译的文本。
         * to : en 表示目标语言的语言代码
         */

        private String text;
        private String to;
        private Rect rect;

        public Rect getRect() {
            return rect;
        }

        public void setRect(Rect rect) {
            this.rect = rect;
        }

        public String getText() {
            return text;
        }

        public void setText(String text) {
            this.text = text;
        }

        public String getTo() {
            return to;
        }

        public void setTo(String to) {
            this.to = to;
        }
    }
}
